programming4us
           
 
 
Programming

Visual Basic 2010 : Deploying Applications with ClickOnce

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
7/11/2013 3:57:32 AM

To deploy an application with ClickOnce, you have three options: the Publish command in the Build menu, right-clicking the project in Solution Explorer, and selecting Publish or the Publish Now button in the ClickOnce configuration page within My Project. For now we focus on the first option, whereas the second option is covered in the next section. Now create a new WPF project with Visual Basic and name it ClickOnceDemo. There is no need to write code for the application because we need only a base for our example. In order to deploy an application with ClickOnce, follow these steps:

1.
Click Build, Publish, Visual Studio launches the Publish Wizard. Figure 1 shows the first dialog of the wizard, in which you need to specify the location where the application will be published. Notice how the dialog also explains available possibilities, such as disk path, network shared path, ftp server, or website. You can change the target type and location by clicking Browse. In this case let’s publish the application to the local Internet Information Services website, which requires Visual Studio to be running with administrator privileges.

Figure 1. Choosing the target location for the ClickOnce deployment.



Publishing to File System

Publish the application to a local folder on the file system if you want to deploy the application on media supports such as CD-ROM or zipped archives. This option can make the application available only offline.


2.
Click Next. The second dialog of the wizard enables specifying if the application will be available offline. In this case the .NET Framework creates a shortcut in the Start menu for launching the application and another one in the Add/Remove Programs tool for enabling uninstalling the application. Figure 2 shows how you set this option. Basically, this is all the information that Visual Studio needs to create a ClickOnce deployment.

Figure 2. Specifying how the application will be available.

3.
Click Next. You will see the last dialog of the wizard showing the deployment information summary (see Figure 3).

Figure 3. Collecting summary information for the ClickOnce deployment.

4.
Click Finish, Visual Studio generates all the required files and folders. Because the deployment is currently done for a web server, Visual Studio also generates a Publish.htm web page that is the place from which users can install the application. Figure 4 shows the page created for this sample application.



Figure 4. The Web page from which the application will be downloaded.

Tips on the Publish.htm Web Page

Being a simple Html page, the default Publish.htm can be edited to accomplish your particular needs or just to provide a different appearance. In this case the web page address points to the local IIS, but if you publish the application onto a real server, you probably do this via an FTP account, whereas the web page address, where users install the application from, is something like this: http://www.something.com/ClickOnceDemo/publish.htm.


Now click Install. At this point a security warning informs you that the application is downloading from a website with other information about the publisher, as shown in Figure 5.

Figure 5. ClickOnce shows a security warning asking confirmation before installing the application and providing information on the application’s publisher and source.

Because you are the publisher and you trust yourself, click Install. This installs the application on your system, and a shortcut will be added to the Start menu. To remove the application simply open the Control Panel, Programs and Features tool, and then select the application from the list.

Structure of a ClickOnce Deployment

The publish process, whatever target you select, generates a subfolder containing the following elements:

  • A bootstrapper file named Setup.exe, which launches the installation.

  • The application manifest, which contains information on how the application has to be run in the ClickOnce context.

  • The Publish.htm file (only if the application has been published to a Web or FTP space).

  • A subfolder containing the actual application and related files. This subfolder has a version number that is recognized by the .NET Framework when the application finds updates.

If you publish the application to the file system for deploying to media supports such as a CD-ROM, you just need to copy to the media the content of the publish folder.

Tip

Unless you specify a publish folder, the deployment package is published to Bin\Debug\Publish or Bin\Release\Publish depending on the selected configuration.

Other -----------------
- ASP.NET 4 in VB 2010 : Site Maps (part 3) - Binding Portions of a Site Map, The SiteMap Class
- ASP.NET 4 in VB 2010 : Site Maps (part 2) - Binding an Ordinary Page to a Site Map, Binding a Master Page to a Site Map
- ASP.NET 4 in VB 2010 : Site Maps (part 1) - Defining a Site Map
- DirectX 10 Game Programming : Shaders and Effects - Vertex Shaders
- DirectX 10 Game Programming : Shaders and Effects - High Level Shading Language
- DirectX 10 Game Programming : Shaders and Effects - Effect Files
- Programming Windows Services with Microsoft Visual Basic 2008 : Services and Polling - Updating the Service Events
- Programming Windows Services with Microsoft Visual Basic 2008 : Services and Polling - Adding a Module File, Adding New Polling Code
- Microsoft Visual Studio 2010 : Using the Concurrency Visualizer (part 3) - The Cores View
- Microsoft Visual Studio 2010 : Using the Concurrency Visualizer (part 2) - CPU Utilization View, The Threads View
- Microsoft Visual Studio 2010 : Using the Concurrency Visualizer (part 1)
- Microsoft Visual Studio 2010 : Reports and Debugging - Using the Parallel Stacks Window
- Microsoft Visual Studio 2010 : Reports and Debugging - Using the Parallel Tasks Window
- Microsoft Visual Studio 2010 : Debugging with Visual Studio 2010 (part 2) - Debugging Threads
- Microsoft Visual Studio 2010 : Debugging with Visual Studio 2010 (part 1) - Live Debugging, Performing Post-Mortem Analysis
- .NET Components : Serialization and Class Hierarchies (part 2) - Manual Base-Class Serialization
- .NET Components : Serialization and Class Hierarchies (part 1) - Custom Serialization and Base Classes
- .NET Components : Custom Serialization (part 2) - Constraining Serialization
- .NET Components : Custom Serialization (part 1) - The ISerializable Interface, Implementing ISerializable
- .NET Components : Serialization and Streams - Serializing Multiple Objects
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us